

*Replication do-file for Barr and Stein (2024) "Social status and egalitarianism in non-lineage-based, agrarian communities in sub-Saharan Africa: An analysis of funeral attendance"


***************************
***	PRELIMS
*	GLOBALS
*	TABLE NOTES
*	EXTRA VARIABLES FOR SUMSTATS TABLES
*	VARLABELS FOR SUMSTATS TABLES
*	VARLABELS FOR RESULTS TABLES

***	SUMMARY STATISTICS
*	TABLE 1
*	TABLE A1

***	MAIN RESULTS TABLES
*	TABLE 2
*	TABLE 3

***	APPENDIX RESULTS TABLES
*	TABLE A2
*	TABLE A3

***************************

*cd ....
use funerals_BarrStein_replication.dta, clear


***	PRELIMS
***************************

*	GLOBALS

global rhs1 ihscinclagD age1D hdysD femhhhD hhsizeD invillL causeD3 ageD femaleD residentD123 buriedD deadhhhD cohhrelig cohhburialL2 relatedness vill* year*

global rhs2 ihscinclagD age1D hdysD femhhhD hhsizeD ihscinclagL age1L hdysL femhhhL hhsizeL invillL causeD3 ageD femaleD residentD123 buriedD deadhhhD cohhrelig cohhburialL2 relatedness vill* year*


*	TABLE NOTES

local tablenotes1 \begin{tablenotes} \scriptsize \item \underline{Notes}: Panel A: Summary statistics for the main sample (3,458 observations); Panel B: Summary statistics for the robustness check sample (1,396 observations). Each observation is a funeral-attending household dyad. Income (transformed) is crop income transfomed using the inverse hyperbolic sine transformation. Assistance is a dummy equal to one if the host provided assistance to another household in the village in the previous year. Dyadic assistance is a dummy equal to one if the host provided assistance to the attendee in the previous year. \end{tablenotes}

local tablenotesA1 \begin{tablenotes} \scriptsize \item \underline{Notes}: Summary statistics for the robustness check sample (1,396 observations); each observation is a funeral-potential host dyad. Income (transformed) is crop income transfomed using the inverse hyperbolic sine transformation. Dyadic assistance is a dummy equal to one if the host provided assistance to the attendee in the previous year. \end{tablenotes}

local tablenotes2 \begin{tablenotes} \scriptsize \item[] \underline{Notes}: The dependent variable is a dummy indicating whether the attending household attended a given funeral of the hosting household. Its mean is 0.761 in the main sample (Columns (1) and (2), 3,458 dyadic observations), and 0.814 in the robustness check sample (Columns (3) and (4), 1,396 dyadic observations). Income is lagged income transformed using the inverse hyperbolic sine transformation. hhh stands for household head. The first row displays coefficient "$\beta$" from equation 1 in Columns (1) and (3) and "$\phi$" from equation 2 in Columns (2) and (4). All models are estimated using weighted least squares and include year, village and attending household fixed effects. P-values obtained using dyadic standard errors (Cameron and Miller, 2014) shown in parentheses. Significance levels are denoted as follows: `"* p$<$0.10, ** p$<$0.05, *** p$<$0.01."' \end{tablenotes}

local tablenotes3 \begin{tablenotes} \scriptsize \item[] \underline{Notes}: The dependent variable is a dummy indicating whether the attending household attended a given funeral of the hosting household; its mean is 0.761. Income is lagged income transformed using the inverse hyperbolic sine transformation. Assistance is a dummy equal to one if the host provided assistance to another household in the village in the previous year. hhh stands for household head. The first row displays coefficient "$\phi$" from equation 2 in Column (1) and "$\pi$" from equation 3 in Columns (2) to (4). Column (1) repeats Columns (2) from Table 2. All models are estimated using weighted least squares and include year, village and attending household fixed effects. P-values obtained using dyadic standard errors (Cameron and Miller, 2014) shown in parentheses. Significance levels are denoted as follows: `"* p$<$0.10, ** p$<$0.05, *** p$<$0.01."' \end{tablenotes}

local tablenotesA2 \begin{tablenotes} \scriptsize \item[] \underline{Notes}: The dependent variable is a dummy indicating whether the attending household attended a given funeral of the hosting household. Its mean is 0.761 in the main sample (Columns (1) and (2), 3,458 dyadic observations), and 0.814 in the robustness check sample (Columns (3) to (6), 1,396 dyadic observations). Income is lagged income transformed using the inverse hyperbolic sine transformation. hhh stands for household head. The first row displays coefficient "$\beta$" from equation 1 in Columns (1), (3) and (5) and "$\phi$" from equation 2 in Columns (2), (4) and (6). All models are estimated using weighted least squares and include year, village and attending household fixed effects. P-values obtained using dyadic standard errors (Cameron and Miller, 2014) shown in parentheses. Significance levels are denoted as follows: `"* p$<$0.10, ** p$<$0.05, *** p$<$0.01."' \end{tablenotes}

local tablenotesA3 \begin{tablenotes} \scriptsize \item[] \underline{Notes}: The dependent variable is a dummy indicating whether the attending household attended a given funeral of the hosting household. Columns (1) to (4) show the models of Table 3 when attending household controls are included and thus use the robustness check sample (1,396 dyadic observations; dependant variable mean 0.814). Column (5) uses the same sample to estimate a dyad-level assistance and solidarity version of the model of Column (2) (see Footnote 6). Income is lagged income transformed using the inverse hyperbolic sine transformation. Assistance and Dyadic assistance respectively are dummies equal to one if the host provided assistance to another household in the village in the previous year or respecitvely provided assistance to the attending household. hhh stands for household head. Deceased person and attending household characteristics are included but omitted from the table for space.  All models are estimated using weighted least squares and include year, village and attending household fixed effects. P-values obtained using dyadic standard errors (Cameron and Miller, 2014) shown in parentheses. Significance levels are denoted as follows: `"* p$<$0.10, ** p$<$0.05, *** p$<$0.01."' \end{tablenotes}


*	EXTRA VARIABLES FOR SUMSTATS TABLES

gen cinclagTD=cinclagD/1000
gen cinclagTL=cinclagL/1000
gen relatedany=(relatedness>0) if !mi(relatedness)

	
*	VARLABELS FOR SUMSTATS TABLES

cap program drop labtab1
program define labtab1

	syntax
	label var attendanceLbin "$\textsc{Funeral attendance}$"
	label var cinclagTD "\hspace{0.3cm}Lagged yearly income (in 1,000 Zim \textdollar, 1992 prices)"
	label var cinclagTL "\hspace{0.3cm}Lagged yearly income (in 1,000 Zim \textdollar, 1992 prices)"
	label var ihscinclagD "\hspace{0.3cm}Lagged yearly income (transformed)"
	label var ihscinclagL "\hspace{0.3cm}Lagged yearly income (transformed)"
	label var age1D "\hspace{0.3cm}Age of the head"
	label var hdysD "\hspace{0.3cm}Education of the head"
	label var femhhhD "\hspace{0.3cm}Household head female"
	label var hhsizeD "\hspace{0.3cm}Household size"
	label var age1L "\hspace{0.3cm}Age of the head"
	label var hdysL "\hspace{0.3cm}Education of the head"
	label var femhhhL "\hspace{0.3cm}Household head female"
	label var hhsizeL "\hspace{0.3cm}Household size"
	label var causeD3 "\hspace{0.3cm}Cause of death unnatural"
	label var ageD "\hspace{0.3cm}Age at death"
	label var femaleD "\hspace{0.3cm}Female"
	label var residentD123 "\hspace{0.3cm}Village resident not visitor"
	label var buriedD "\hspace{0.3cm}Buried in village"
	label var deadhhhD "\hspace{0.3cm}Household head at time of death"
	label var invillL "\hspace{0.3cm}Attending hhh in village at time"
	label var relatedness "\hspace{0.3cm}Relatedness (Hamilton's ratio)"
	label var cohhrelig "\hspace{0.3cm}In same religious group"
	label var cohhburialL2 "\hspace{0.3cm}In same burial society (lagged)"
	label var helpanyhhlag "\hspace{0.3cm}Assistance (lagged)"
	label var helpanyhhSlag "\hspace{0.3cm}Assistance, self-reported (lagged)"
	label var helpanyhhRlag "\hspace{0.3cm}Assistance, recipient-reported (lagged)"
	label var helplag "\hspace{0.3cm}Dyadic assistance (lagged)"
	label var burialDL2 "\hspace{0.3cm}Burial society member (lagged)"
	label var relatedany "\hspace{0.3cm}Related (dummy)"
	
end 


*	VARLABELS FOR RESULTS TABLES

cap program drop labtab2
program define labtab2

	syntax
	label var ihscinclagD "\hspace{0.2cm}Income (transformed; $\beta$, $\phi$)" //IHST and lagged
	label var ihscinclagL "\hspace{0.2cm}Income (transformed)" //IHST and lagged

	foreach v in age1D hdysD femhhhD hhsizeD age1L hdysL femhhhL hhsizeL causeD3 ageD femaleD residentD123 buriedD deadhhhD invillL relatedness cohhrelig{
	local L`v' : variable label `v'
		local LN`v'=subinstr("`L`v''","0.3cm","0.2cm",1)
		label var `v' "`LN`v''"
	}
	
	label var relatednessXihscinclagD "\hspace{0.2cm}Relatedness X Host income ($\lambda$)" //IHST and lagged
	label var cohhburialL2 "\hspace{0.2cm}In same burial society" //twice lagged
	label var cohhburialL2XihscinclagD "\hspace{0.2cm}Same burial soc L2 X Host income"
	
	label var helpanyhhlag "\hspace{0.2cm}Assistance"
	label var hahhlagXihscinclagD "\hspace{0.2cm}Assistance X Host income ($\sigma_{2}$)" //IHST and lagged
	label var helpanyhhSlag "\hspace{0.2cm}Assistance self-reported (S)"
	label var hahhSlagXihscinclagD "\hspace{0.2cm}Assistance S X Host income ($\sigma_{2}$)" //IHST and lagged
	label var helpanyhhRlag "\hspace{0.2cm}Assistance recipient-reported (R)"
	label var hahhRlagXihscinclagD "\hspace{0.2cm}Assistance R X Host income ($\sigma_{2}$)" //IHST and lagged

	label var helplag "\hspace{0.2cm}Dyadic assistance"
	label var helplagXihscinclagD "\hspace{0.2cm}Dyadic assistance X Host income" //IHST and lagged
	label var burialDL2 "\hspace{0.2cm}Burial society member"
	label var burialDL2XihscinclagD "\hspace{0.2cm}Burial society member X Host income ($\sigma_{1}$)"

	label var cohhburialL2XihscinclagD "\hspace{0.2cm}In same burial society X Host income" //twice lagged
	
end 

cap program drop labtab3
program define labtab3

	syntax
	label var ihscinclagD "\hspace{0.2cm}Income (transformed; $\phi$, $\pi$)" //IHST and lagged

end 

cap program drop labtabA3
program define labtabA3

	syntax
	label var ihscinclagD "\hspace{0.2cm}Income (transformed)" //IHST and lagged

end 



*** SUMMARY STATISTICS
***********************

*TABLE 1


labtab1
est drop _all

estpost tabstat attendanceLbin ///
				cinclagTD ihscinclagD age1D hdysD femhhhD hhsizeD burialDL2 helpanyhhlag helpanyhhSlag helpanyhhRlag ///
				ageD femaleD deadhhhD causeD3 residentD123 buriedD ///
				invillL cohhrelig cohhburialL2 relatedness relatedany ///
		if sampleF==1, columns(statistics) stat(n mean sd med min max) 

#delimit;
	estout using "funerals_final_sumstats.tex", replace
	cells("mean(fmt(%012.3fc)) sd(fmt(%012.3fc)) p50(fmt(%012.2fc)) min(fmt(%012.1fc)) max(fmt(%012.1fc))") delim("&") style(tex) 
	modelwidth(14) collabels(Mean StD Median Min Max) mlabels(,none) label wrap
	refcat(attendanceLbin "$\textbf{Panel A: Main sample}$" cinclagTD "$\textsc{Hosting household characteristics}$" ageD "$\textsc{Deceased person characteristics}$" invillL "$\textsc{Dyadic characteristics}$", nolabel)
	prehead(
			\centering \begin{threeparttable} 
			\setlength{\tabcolsep}{1.5pt} \begin{tabular}{l *{7}{>{\centering\arraybackslash}p{1.1cm}}} \hline \hline) 
	posthead(\hline)
	postfoot("\hline 
		$\textsc{Observations}$  &  `e(N)' &    &    &    &   \\
		\hline \hline \end{tabular} 
		\end{threeparttable}
	")
;
#delimit cr


estpost tabstat cinclagTL ihscinclagL age1L hdysL femhhhL hhsizeL ///
		if sampleS==1, columns(statistics) stat(n mean sd med min max) 

#delimit;
	estout using "funerals_final_sumstats.tex", append
	cells("mean(fmt(%012.3fc)) sd(fmt(%012.3fc)) p50(fmt(%012.2fc)) min(fmt(%012.1fc)) max(fmt(%012.1fc))") delim("&") style(tex) 
	modelwidth(14) collabels(" " " " " " " " " ", lhs("$\textbf{Panel B: Robustness check sample}$")) label wrap
	refcat(cinclagTL "$\textsc{Attending household characteristics}$", nolabel)
	prehead(
			\centering \begin{threeparttable} 
			\setlength{\tabcolsep}{1.5pt} \begin{tabular}{l *{7}{>{\centering\arraybackslash}p{1.1cm}}} ) 
	postfoot("\hline 
		$\textsc{Observations}$  &  `e(N)' &    &    &    &   \\
		\hline \hline \end{tabular} 
		`tablenotes1'
	\end{threeparttable}
	")
;
#delimit cr


*TABLE A1

estpost tabstat attendanceLbin ///
				cinclagTD ihscinclagD age1D hdysD femhhhD hhsizeD burialDL2 helpanyhhlag helpanyhhSlag helpanyhhRlag ///
				ageD femaleD deadhhhD causeD3 residentD123 buriedD ///
				invillL cohhrelig cohhburialL2 relatedness relatedany helplag  ///
				cinclagTL ihscinclagL age1L hdysL femhhhL hhsizeL ///
		if sampleS==1, columns(statistics) stat(n mean sd med min max) 

#delimit;
	estout using "funerals_final_sumstatsA.tex", replace
	cells("mean(fmt(%012.3fc)) sd(fmt(%012.3fc)) p50(fmt(%012.2fc)) min(fmt(%012.1fc)) max(fmt(%012.1fc))") delim("&") style(tex) 
	modelwidth(14) collabels(Mean StD Median Min Max) mlabels(,none) label wrap
	refcat(cinclagTD "$\textsc{Hosting household characteristics}$" ageD "$\textsc{Deceased person characteristics}$" relatedness "$\textsc{Dyadic characteristics}$" cinclagTL "$\textsc{Attending household characteristics}$", nolabel)
	prehead(
			\centering \begin{threeparttable} 
			\setlength{\tabcolsep}{1.5pt} \begin{tabular}{l *{7}{>{\centering\arraybackslash}p{1.1cm}}} \hline \hline) 
	posthead(\hline)
	postfoot("\hline 
		$\textsc{Observations}$  &  `e(N)' &    &    &    &   \\
		\hline \hline \end{tabular} 
		`tablenotesA1'
	\end{threeparttable}
	")
;
#delimit cr



***	MAIN RESULTS TABLES
***********************

*TABLE 2

labtab2
est drop _all
	
	local r=1
	while `r'{
		regdyad2 attendanceLbin $rhs1 HHidL_* [pweight=weight], dyads(HHidD HHidL)
			if _se[ihscinclagD]!=0{
				local r=0
			}
	}
		est store c21

	local r=1
	while `r'{
		regdyad2 attendanceLbin $rhs1 relatednessXihscinclagD HHidL_* [pweight=weight], dyads(HHidD HHidL)
			if _se[ihscinclagD]!=0{
				local r=0
			}
	}
		est store c22
		
	local r=1
	while `r'{
		regdyad2 attendanceLbin $rhs2 HHidL_* [pweight=weight], dyads(HHidD HHidL)
			if _se[ihscinclagD]!=0{
				local r=0
			}
	}
		est store c23
		
	local r=1
	while `r'{
		regdyad2 attendanceLbin $rhs2 relatednessXihscinclagD HHidL_* [pweight=weight], dyads(HHidD HHidL)
			if _se[ihscinclagD]!=0{
				local r=0
			}
	}
		est store c24

		
	#delimit;
		estout _all using "funerals_final_table2.tex", replace 
		cells(b(star fmt(%10.3f)) p(par)) delim("&") style(tex) starlevels(* 0.1 ** 0.05 *** 0.01) 
		modelwidth(12) collabels(none) label mlabels(, depvar none) numbers
		varlabels(_cons "Constant")
		drop(vil* year* HHidL_* _cons)
		order(ihscinclagD age1D hdysD femhhhD hhsizeD ageD femaleD deadhhhD causeD3 residentD123 buriedD invillL cohhrelig cohhburialL2 relatedness relatednessXihscinclagD ihscinclagL age1L hdysL femhhhL hhsizeL)
		refcat(ihscinclagD "$\textsc{Hosting household}$" ageD "$\textsc{Deceased person}$" invillL "$\textsc{Dyadic characteristics}$" ihscinclagL "$\textsc{Attending household}$", nolabel)
		stats(N, fmt(%5.0f) 
		labels("Observations"))
		prehead(
				\centering \begin{threeparttable} 
				\setlength{\tabcolsep}{1.3pt} \begin{tabular}{m{6cm} *{@E}{>{\centering\arraybackslash}m{1.5cm}}} \hline \hline) 
		posthead(\hline) prefoot(\hline) 
		postfoot(\hline \hline \end{tabular}
				`tablenotes2'
				\end{threeparttable} 
				) 
		;
	#delimit cr 



*TABLE 3

labtab3 

est drop _all

	local r=1
	while `r'{
		regdyad2 attendanceLbin $rhs1 relatednessXihscinclagD HHidL_* [pweight=weight], dyads(HHidD HHidL)
			if _se[ihscinclagD]!=0{
				local r=0
			}
	}
		est store c31

	local r=1
	while `r'{
		regdyad2 attendanceLbin $rhs1 burialDL2 helpanyhhlag burialDL2XihscinclagD hahhlagXihscinclagD relatednessXihscinclagD HHidL_* [pweight=weight], dyads(HHidD HHidL)
			if _se[ihscinclagD]!=0{
				local r=0
			}
	}
		est store c32

	local r=1
	while `r'{
		regdyad2 attendanceLbin $rhs1 burialDL2 helpanyhhSlag burialDL2XihscinclagD hahhSlagXihscinclagD relatednessXihscinclagD HHidL_* [pweight=weight], dyads(HHidD HHidL)
			if _se[ihscinclagD]!=0{
				local r=0
			}
	}
		est store c33
			
	local r=1
	while `r'{
		regdyad2 attendanceLbin $rhs1 burialDL2 helpanyhhRlag burialDL2XihscinclagD hahhRlagXihscinclagD relatednessXihscinclagD HHidL_* [pweight=weight], dyads(HHidD HHidL)
			if _se[ihscinclagD]!=0{
				local r=0
			}
	}
		est store c34


	#delimit;
		estout _all using "funerals_final_table3.tex", replace 
		cells(b(star fmt(%10.3f)) p(par)) delim("&") style(tex) starlevels(* 0.1 ** 0.05 *** 0.01) 
		modelwidth(12) collabels(none) label mlabels(, depvar none) numbers
		varlabels(_cons "Constant")
		drop(vil* year* HHidL_* _cons)
		order(ihscinclagD age1D hdysD femhhhD hhsizeD  burialDL2 burialDL2XihscinclagD helpanyhhlag hahhlagXihscinclagD helpanyhhSlag hahhSlagXihscinclagD helpanyhhRlag hahhRlagXihscinclagD ageD femaleD deadhhhD causeD3 residentD123 buriedD invillL cohhrelig cohhburialL2 relatedness relatednessXihscinclagD)
		refcat(ihscinclagD "$\textsc{Hosting household}$" ageD "$\textsc{Deceased person}$" invillL "$\textsc{Dyadic characteristics}$", nolabel)
		stats(N, fmt(%5.0f) 
		labels("Observations"))
		prehead(
				\centering \begin{threeparttable} 
				\setlength{\tabcolsep}{1.3pt} \begin{tabular}{m{7cm} *{@E}{>{\centering\arraybackslash}m{1.5cm}}} \hline \hline) 
		posthead(\hline) prefoot(\hline) 
		postfoot(\hline \hline \end{tabular}
				`tablenotes3'
				\end{threeparttable} 
				) 
		;
	#delimit cr




***	APPENDIX RESULTS TABLES
***********************

*TABLE A2

labtab2

est drop _all
	
	local r=1
	while `r'{
		regdyad2 attendanceLbin $rhs1 HHidL_* [pweight=weight], dyads(HHidD HHidL)
			if _se[ihscinclagD]!=0{
				local r=0
			}
	}
		est store cA21

	local r=1
	while `r'{
		regdyad2 attendanceLbin $rhs1 relatednessXihscinclagD HHidL_* [pweight=weight], dyads(HHidD HHidL)
			if _se[ihscinclagD]!=0{
				local r=0
			}
	}
		est store cA22

	local r=1
	while `r'{
		regdyad2 attendanceLbin $rhs2 HHidL_* [pweight=weight], dyads(HHidD HHidL)
			if _se[ihscinclagD]!=0{
				local r=0
			}
	}
		est store cA23
		
	local r=1
	while `r'{
		regdyad2 attendanceLbin $rhs2 relatednessXihscinclagD HHidL_* [pweight=weight], dyads(HHidD HHidL)
			if _se[ihscinclagD]!=0{
				local r=0
			}
	}
		est store cA24

	local r=1
	while `r'{
		regdyad2 attendanceLbin $rhs1 HHidL_* [pweight=weight] if sampleS==1, dyads(HHidD HHidL)
			if _se[ihscinclagD]!=0{
				local r=0
			}
	}
		est store cA25

	local r=1
	while `r'{
		regdyad2 attendanceLbin $rhs1 relatednessXihscinclagD HHidL_* [pweight=weight] if sampleS==1, dyads(HHidD HHidL)
			if _se[ihscinclagD]!=0{
				local r=0
			}
	}
		est store cA26
		
	#delimit;
		estout _all using "funerals_final_tableA2.tex", replace 
		cells(b(star fmt(%10.3f)) p(par)) delim("&") style(tex) starlevels(* 0.1 ** 0.05 *** 0.01) 
		modelwidth(12) collabels(none) label mlabels(, depvar none) numbers
		varlabels(_cons "Constant")
		
		drop(vil* year* HHidL_* _cons)
		order(ihscinclagD age1D hdysD femhhhD hhsizeD ageD femaleD deadhhhD causeD3 residentD123 buriedD invillL cohhrelig cohhburialL2 relatedness relatednessXihscinclagD ihscinclagL age1L hdysL femhhhL hhsizeL)
		refcat(ihscinclagD "$\textsc{Hosting household}$" ageD "$\textsc{Deceased person}$" invillL "$\textsc{Dyadic characteristics}$" ihscinclagL "$\textsc{Attending household}$", nolabel)
		stats(N, fmt(%5.0f) 
		labels("Observations"))		
		prehead(
				\centering \begin{threeparttable} 
				\setlength{\tabcolsep}{1.3pt} \begin{tabular}{m{5.5cm} *{@E}{>{\centering\arraybackslash}m{1.5cm}}} \hline \hline) 
		posthead(\hline) prefoot(\hline) 
		postfoot(\hline \hline \end{tabular}
				`tablenotesA2'
				\end{threeparttable} 
				) 
		;
	#delimit cr



*TABLE A3

labtabA3

est drop _all

	local r=1
	while `r'{
		regdyad2 attendanceLbin $rhs2 relatednessXihscinclagD HHidL_* [pweight=weight], dyads(HHidD HHidL)
			if _se[ihscinclagD]!=0{
				local r=0
			}
	}
		est store cA31
		estadd local incl yes

	local r=1
	while `r'{
		regdyad2 attendanceLbin $rhs2 burialDL2 helpanyhhlag burialDL2XihscinclagD hahhlagXihscinclagD relatednessXihscinclagD HHidL_* [pweight=weight], dyads(HHidD HHidL)
			if _se[ihscinclagD]!=0{
				local r=0
			}
	}
		est store cA32
		estadd local incl yes

	local r=1
	while `r'{
		regdyad2 attendanceLbin $rhs2 burialDL2 helpanyhhSlag burialDL2XihscinclagD hahhSlagXihscinclagD relatednessXihscinclagD HHidL_* [pweight=weight], dyads(HHidD HHidL)
			if _se[ihscinclagD]!=0{
				local r=0
			}
	}
		est store cA33
		estadd local incl yes

	local r=1
	while `r'{
		regdyad2 attendanceLbin $rhs2 burialDL2 helpanyhhRlag burialDL2XihscinclagD hahhRlagXihscinclagD relatednessXihscinclagD HHidL_* [pweight=weight], dyads(HHidD HHidL)
			if _se[ihscinclagD]!=0{
				local r=0
			}
	}
		est store cA34
		estadd local incl yes

	local r=1
	while `r'{
		regdyad2 attendanceLbin $rhs2 helplag helplagXihscinclagD cohhburialL2XihscinclagD relatednessXihscinclagD HHidL_* [pweight=weight], dyads(HHidD HHidL)
			if _se[ihscinclagD]!=0{
				local r=0
			}
	}
		est store cA35
		estadd local incl yes

	#delimit;
		estout _all using "funerals_final_tableA3.tex", replace 
		cells(b(star fmt(%10.3f)) p(par)) delim("&") style(tex) starlevels(* 0.1 ** 0.05 *** 0.01) 
		modelwidth(12) collabels(none) label mlabels(, depvar none) numbers
		varlabels(_cons "Constant")
		drop(vil* year* HHidL_*  ageD femaleD deadhhhD causeD3 residentD123 buriedD ihscinclagL age1L hdysL femhhhL hhsizeL _cons)
		order(ihscinclagD age1D hdysD femhhhD hhsizeD burialDL2 burialDL2XihscinclagD helpanyhhlag hahhlagXihscinclagD helpanyhhSlag hahhSlagXihscinclagD helpanyhhRlag hahhRlagXihscinclagD ageD femaleD deadhhhD causeD3 residentD123 buriedD invillL cohhrelig cohhburialL2 relatedness relatednessXihscinclagD)
		refcat(ihscinclagD "$\textsc{Hosting household}$" ageD "$\textsc{Deceased person}$" invillL "$\textsc{Dyadic characteristics}$", nolabel)
		stats(incl N, fmt(%5.0f %5.0f)
		labels("Deceased person and Attending household characteristics included" "Observations"))
		prehead(
				\centering \begin{threeparttable} 
				\setlength{\tabcolsep}{1.3pt} \begin{tabular}{m{7cm} *{@E}{>{\centering\arraybackslash}m{1.5cm}}} \hline \hline) 
		posthead(\hline) prefoot(\hline) 
		postfoot(\hline \hline \end{tabular}
				`tablenotesA3'
				\end{threeparttable} 
				) 
		;
	#delimit cr




